$('body').on('touchmove',function(e){
        e.preventDefault();
});
$('.container').width(sWidth).height(h);
$('.page').width(sWidth).height(_rate*1334);
$('.share-t1').width(sWidth).height(_rate*690).css({"top":0, "left":0});
$('.share-t2').width(sWidth).height(_rate*120).css({"bottom":_rate*40, "left":0});
$('.p-logo').width(_rate*234).height(_rate*32).css({"top":_rate*40, "left":_rate*48});
$('.p1-2').width(_rate*49).height(_rate*50).css({"top":_rate*42, "left":_rate*652});
$('.p1-6').width(_rate*750).height(_rate*159).css({"top":_rate*352, "left":_rate*0});
$('.p1-7').width(_rate*750).height(_rate*249).css({"top":_rate*520, "left":_rate*0});

$('.p1-4').width(_rate*81).height(_rate*18).css({"top":_rate*1174, "left":_rate*339});
$('.p1-3').width(_rate*71).height(_rate*71).css({"top":_rate*1200, "left":_rate*344});
$('.p1-5').width(_rate*66).height(_rate*17).css({"top":_rate*1251, "left":_rate*50});
$('.music').css({"top":_rate*1268, "right":_rate*50});


$('.p1-8').width(_rate*54).height(_rate*53).css({"top":_rate*1227, "left":_rate*650});
$('.p4-1').width(_rate*750).height(_rate*652).css({"top":_rate*223, "left":_rate*0});
$('.p4-2').width(_rate*654).height(_rate*79).css({"top":_rate*928, "left":_rate*53});
$('.p4-3').width(_rate*654).height(_rate*138).css({"top":_rate*1048, "left":_rate*53});
$('.p5-1').width(_rate*693).height(_rate*1127).css({"top":_rate*21, "left":_rate*30});
$('.p7-3').width(_rate*693).height(_rate*907).css({"top":_rate*124, "left":_rate*30});
$('.p7-1').width(_rate*159).height(_rate*40).css({"top":_rate*1065, "left":_rate*296});
$('.p7-2').width(_rate*85).height(_rate*22).css({"top":_rate*1124, "left":_rate*331});
$('.p8-2').width(_rate*750).height(_rate*1057).css({"top":_rate*0, "left":_rate*0});
$('.p8-1').width(_rate*321).height(_rate*38).css({"top":_rate*1084, "left":_rate*215});
$('.p9-1').width(_rate*694).height(_rate*953).css({"top":_rate*25, "left":_rate*29});
$('.p9-2').width(_rate*159).height(_rate*41).css({"top":_rate*1068, "left":_rate*296});
$('.p9-3').width(_rate*85).height(_rate*23).css({"top":_rate*1125, "left":_rate*333});
$('.p10-2').width(_rate*750).height(_rate*1059).css({"top":_rate*0, "left":_rate*0});
$('.p10-1').width(_rate*340).height(_rate*35).css({"top":_rate*1084, "left":_rate*203});
$('.p11-3').width(_rate*694).height(_rate*876).css({"top":_rate*140, "left":_rate*30});
$('.p11-1').width(_rate*158).height(_rate*39).css({"top":_rate*1040, "left":_rate*560});
$('.p11-2').width(_rate*85).height(_rate*23).css({"top":_rate*1098, "left":_rate*626});
$('.p12-2').width(_rate*750).height(_rate*1057).css({"top":_rate*0, "left":_rate*0});
$('.p12-1').width(_rate*186).height(_rate*37).css({"top":_rate*1083, "left":_rate*280});
$('.p13-2').width(_rate*191).height(_rate*53).css({"top":_rate*135, "left":_rate*70});
$('.p13-3').width(_rate*109).height(_rate*143).css({"top":_rate*235, "left":_rate*70});
$('.p13-4').width(_rate*166).height(_rate*28).css({"top":_rate*400, "left":_rate*70});
$('.p13-1').width(_rate*692).height(_rate*847).css({"top":_rate*460, "left":_rate*30});
$('.p14-1').width(_rate*76).height(_rate*75).css({"top":_rate*135, "left":_rate*85});
$('.p14-2').width(_rate*296).height(_rate*147).css({"top":_rate*255, "left":_rate*85});
$('.p14-3').width(_rate*342).height(_rate*228).css({"top":_rate*465, "left":_rate*85});
$('.p14-4').width(_rate*274).height(_rate*381).css({"top":_rate*634, "left":_rate*448});
$('.p14-5').width(_rate*410).height(_rate*550).css({"top":_rate*757, "left":_rate*29});
$('.p14-6').width(_rate*273).height(_rate*281).css({"top":_rate*1027, "left":_rate*448});
$('.p15-1').width(_rate*275).height(_rate*52).css({"top":_rate*137, "left":_rate*70});
$('.p15-2').width(_rate*113).height(_rate*115).css({"top":_rate*226, "left":_rate*66});
$('.p15-3').width(_rate*141).height(_rate*28).css({"top":_rate*402, "left":_rate*66});
$('.p15-4').width(_rate*693).height(_rate*846).css({"top":_rate*462, "left":_rate*26});
$('.p16-1').width(_rate*278).height(_rate*52).css({"top":_rate*137, "left":_rate*70});
$('.p16-2').width(_rate*233).height(_rate*109).css({"top":_rate*230, "left":_rate*66});
$('.p16-3').width(_rate*114).height(_rate*29).css({"top":_rate*402, "left":_rate*66});
$('.p16-4').width(_rate*694).height(_rate*846).css({"top":_rate*462, "left":_rate*26});
$('.p17-1').width(_rate*385).height(_rate*503).css({"top":_rate*130, "left":_rate*30});
$('.p17-2').width(_rate*289).height(_rate*403).css({"top":_rate*130, "left":_rate*430});
$('.p17-3').width(_rate*289).height(_rate*280).css({"top":_rate*542, "left":_rate*430});
$('.p17-4').width(_rate*76).height(_rate*77).css({"top":_rate*680, "left":_rate*80});
$('.p17-5').width(_rate*176).height(_rate*144).css({"top":_rate*803, "left":_rate*80});
$('.p17-6').width(_rate*276).height(_rate*146).css({"top":_rate*1013, "left":_rate*80});
$('.p18-1').width(_rate*74).height(_rate*74).css({"top":_rate*184, "left":_rate*85});
$('.p18-2').width(_rate*209).height(_rate*103).css({"top":_rate*302, "left":_rate*85});
$('.p18-3').width(_rate*229).height(_rate*229).css({"top":_rate*472, "left":_rate*85});
$('.p18-3').width(_rate*229).height(_rate*229).css({"top":_rate*472, "left":_rate*85});
$('.p18-4').width(_rate*252).height(_rate*375).css({"top":_rate*184, "left":_rate*466});
$('.p18-5').width(_rate*693).height(_rate*351).css({"top":_rate*786, "left":_rate*27});
$('.p19-1').width(_rate*608).height(_rate*51).css({"top":_rate*138, "left":_rate*71});
$('.p19-2').width(_rate*172).height(_rate*114).css({"top":_rate*228, "left":_rate*67});
$('.p19-3').width(_rate*118).height(_rate*25).css({"top":_rate*400, "left":_rate*67});
$('.p19-4').width(_rate*694).height(_rate*846).css({"top":_rate*460, "left":_rate*27});
$('.p20-1').width(_rate*315).height(_rate*214).css({"top":_rate*130, "left":_rate*32});
$('.p20-2').width(_rate*357).height(_rate*471).css({"top":_rate*130, "left":_rate*362});
$('.p20-3').width(_rate*359).height(_rate*244).css({"top":_rate*606, "left":_rate*356});
$('.p20-4').width(_rate*75).height(_rate*76).css({"top":_rate*626, "left":_rate*86});
$('.p20-5').width(_rate*214).height(_rate*106).css({"top":_rate*746, "left":_rate*86});
$('.p20-6').width(_rate*229).height(_rate*229).css({"top":_rate*916, "left":_rate*86});
$('.p21-1').width(_rate*149).height(_rate*173).css({"top":_rate*167, "left":_rate*505});
$('.p21-2').width(_rate*341).height(_rate*47).css({"top":_rate*355, "left":_rate*205});
$('.p21-3').width(_rate*449).height(_rate*120).css({"top":_rate*509, "left":_rate*146});


function _goN(p){
    $(".p"+p).hide();
    var _nextN=parseInt(p)+1;
    
    if(4 == p && _curP == 'jt'){
     _nextN=11;
    }
    if(4 == p && _curP == 'sh'){
     _nextN=9;
    }
    if(10 == p && _curP == 'sh'){
     _nextN=13;
    }
    if(4 == p && _curP == 'wh'){
     _nextN=7;
    }
    if(8 == p && _curP == 'wh'){
     _nextN=13;
    }
    if(6 == p && _curP == 'xc'){
     _nextN=13;
    }
    
    
    $(".p"+_nextN).fadeIn();
   	       
}
function _goP(p){
    if(1 == p){return;}
    $(".p"+p).hide();
    var _preN=parseInt(p)-1;
    
    if(11 == p && _curP == 'jt'){
        _preN=4;
    }
    if(9 == p && _curP == 'sh'){
       _preN=4;
    }
    if(13 == p && _curP == 'sh'){
      _preN=10;
    }
    if(7 == p && _curP == 'wh'){
      _preN=4;
    }
    if(13 == p && _curP == 'wh'){
     _nextN=8;
    }
    if(13 == p && _curP == 'xc'){
     _preN=6;
    }
   	$(".p"+_preN).fadeIn();
}
$(".p1-3").click(function(){
   var _id=$(this).parent().attr("data-id");
   _goN(_id);
});
$(".p1-2").click(function(){
    var _id=$(this).parent().attr("data-id");
    _goP(_id);
});
$(".p1").swipe({swipe:function(event, direction, distance, duration, fingerCount, fingerData) {
   if('up' == direction){_goN(1);}
}});
$(".p2").swipe({swipe:function(event, direction, distance, duration, fingerCount, fingerData) {
	if('down' == direction){_goP(2);}if('up' == direction){_goN(2);}
}});
$(".p3").swipe({swipe:function(event, direction, distance, duration, fingerCount, fingerData) {
	if('down' == direction){_goP(3);}if('up' == direction){_goN(3);}
}});
$(".p4").swipe({swipe:function(event, direction, distance, duration, fingerCount, fingerData) {
	if('down' == direction){_goP(4);}if('up' == direction){_goN(4);}
}});
$(".p5").swipe({swipe:function(event, direction, distance, duration, fingerCount, fingerData) {
	if('down' == direction){_goP(5);}if('up' == direction){_goN(5);}
}});
$(".p6").swipe({swipe:function(event, direction, distance, duration, fingerCount, fingerData) {
	if('down' == direction){_goP(6);}if('up' == direction){_goN(6);}
}});
$(".p7").swipe({swipe:function(event, direction, distance, duration, fingerCount, fingerData) {
	if('down' == direction){_goP(7);}if('up' == direction){_goN(7);}
}});
$(".p8").swipe({swipe:function(event, direction, distance, duration, fingerCount, fingerData) {
	if('down' == direction){_goP(8);}if('up' == direction){_goN(8);}
}});
$(".p9").swipe({swipe:function(event, direction, distance, duration, fingerCount, fingerData) {
	if('down' == direction){_goP(9);}if('up' == direction){_goN(9);}
}});
$(".p10").swipe({swipe:function(event, direction, distance, duration, fingerCount, fingerData) {
	if('down' == direction){_goP(10);}if('up' == direction){_goN(10);}
}});
$(".p11").swipe({swipe:function(event, direction, distance, duration, fingerCount, fingerData) {
	if('down' == direction){_goP(11);}if('up' == direction){_goN(11);}
}});
$(".p12").swipe({swipe:function(event, direction, distance, duration, fingerCount, fingerData) {
	if('down' == direction){_goP(12);}if('up' == direction){_goN(12);}
}});
$(".p13").swipe({swipe:function(event, direction, distance, duration, fingerCount, fingerData) {
	if('down' == direction){_goP(13);}if('up' == direction){_goN(13);}
}});
$(".p14").swipe({swipe:function(event, direction, distance, duration, fingerCount, fingerData) {
	if('down' == direction){_goP(14);}if('up' == direction){_goN(14);}
}});
$(".p15").swipe({swipe:function(event, direction, distance, duration, fingerCount, fingerData) {
	if('down' == direction){_goP(15);}if('up' == direction){_goN(15);}
}});
$(".p16").swipe({swipe:function(event, direction, distance, duration, fingerCount, fingerData) {
	if('down' == direction){_goP(16);}if('up' == direction){_goN(16);}
}});
$(".p17").swipe({swipe:function(event, direction, distance, duration, fingerCount, fingerData) {
	if('down' == direction){_goP(17);}if('up' == direction){_goN(17);}
}});
$(".p18").swipe({swipe:function(event, direction, distance, duration, fingerCount, fingerData) {
	if('down' == direction){_goP(18);}if('up' == direction){_goN(18);}
}});
$(".p19").swipe({swipe:function(event, direction, distance, duration, fingerCount, fingerData) {
	if('down' == direction){_goP(19);}if('up' == direction){_goN(19);}
}});
$(".p20").swipe({swipe:function(event, direction, distance, duration, fingerCount, fingerData) {
	if('down' == direction){_goP(20);}if('up' == direction){_goN(20);}
}});
$(".p21").swipe({swipe:function(event, direction, distance, duration, fingerCount, fingerData) {
	if('down' == direction){_goP(21);}if('up' == direction){_goN(21);}
}});


wx.config({
    	appId: '<?php echo $signPackage["appId"];?>',timestamp: <?php echo $signPackage["timestamp"];?>,
    	nonceStr: '<?php echo $signPackage["nonceStr"];?>',signature: '<?php echo $signPackage["signature"];?>',
    	jsApiList: ['onMenuShareTimeline', 'onMenuShareAppMessage','onMenuShareQQ','showMenuItems','showOptionMenu']
    });
wx.ready(function () {
    var _desc='追寻美好生活，向着心中的那道光勇敢前行。';
    var _imgUrl='http://mei94.com/dian/img/light/64.png';
    wx.onMenuShareTimeline({title: _title, link: _link, imgUrl: _imgUrl,success: function () {},cancel: function () { }});
    wx.onMenuShareAppMessage({ title: _title, desc: _desc,link: _link,imgUrl: _imgUrl, type: '', dataUrl: '', success: function () {},cancel: function () {  }});  	
});

